<template>
  <div>
    <h1>app</h1>
    <xiao-tou></xiao-tou>
    <zhong-tou></zhong-tou>
  </div>
</template>

<script>
import XiaoTou from "./components/XiaoTou.vue";
import ZhongTou from "./components/ZhongTou.vue";
export default {
  name: "",
  props: [""],
  data() {
    return {
      info: "app上的信息,要将消息传递给铁头",
    };
  },

  components: { XiaoTou, ZhongTou },

  computed: {},
  /* provide 可以是对象类型 也可以是函数类型 
  在对象中 this  undefined 
  在函数中 this执行当前组件对象
  
  */
  /* provide: {
    name: "niuniu",
    obj: [
      { name: "tom", age: 10 },
      { name: "tutu", info: "醒醒！！" },
    ],
    info: this.info,
  }, */
  provide() {
    return {
      name: "niuniu",
      obj: [
        { name: "tom", age: 10 },
        { name: "tutu", info: "醒醒！！" },
      ],
      info: this.info,
    };
  },
  beforeMount() {},

  mounted() {},

  methods: {},

  watch: {},
};
</script>
<style lang='' scoped>
</style>